<%@ page language="java" pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="ww" uri="webwork" %>

<div >
	<ul id="previewTree" class="ztree"></ul>
</div>
<script type="text/javascript">
var $series=$('#series',$navTab.focus()).val();
var preview_org_setting = {
		data : {
			simpleData : {
				enable : true
			}
		},
		async: {
			enable: true,
			url:"dirPreviewTree.action?series="+$series,
			autoParam:["id=parentId"],
			type:"post"
		},
		callback : {
			onAsyncSuccess : function(event, treeId, treeNode, msg){
			var treeObj = $.fn.zTree.getZTreeObj(treeId);
			if(treeObj.getSelectedNodes().length==0){
				var nodes = treeObj.getNodes();
				treeObj.selectNode(nodes[0]);
			}
		}
		}

	};
var treeNodes=<ww:property value="result"/>;
var rf_tree  = null;
using(['tree'],function(){
	preview_org_setting.async.otherParam = ["parentId", $("#parentId",$navTab.focus()).val()];
   rf_tree =  $.fn.zTree.init($("#previewTree",$navTab.focus()), preview_org_setting, treeNodes); 
   if($("#parentId").val()==""){
	   $("#parentId").val('8a8d81bc44fc43890144fc438d240000');
   }
})
</script>